/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * PanelPaso1.java
 *
 * Created on 11-nov-2009, 12:48:49
 */
package pestañas;

import dialogos.DialogoMetodoMPF;
import java.awt.Color;
import java.awt.event.ItemEvent;
import javax.swing.JProgressBar;

import javax.swing.JRadioButton;
import javax.swing.JTextField;
import javax.swing.event.UndoableEditEvent;
import javax.swing.event.UndoableEditListener;
import net.java.balloontip.BalloonTip;
import net.java.balloontip.styles.MinimalBalloonStyle;
import net.java.balloontip.utils.TimingUtils;
import utilidades.ListenerTextBox;
import utilidades.ValidaBarras2;
import utilidades.ValoresMetodologiaEstimacion;
import vistas.VistaPrincipal;

/**
 *
 * @author Shidobu
 */
public class PanelPaso1 extends javax.swing.JPanel {

    VistaPrincipal vista;
    public static JProgressBar barraProgreso;
    boolean cambioPeriodoEntrega;
    boolean cambioLugarEvaluacion;
    boolean cambioTamañoSoftware;

    //Cada panel de la pestaña 1 esta dividivo y se le asigna un valor, al comienzo es cero
    static int valorp1 = 0;
    static int valorp2 = 0;
    static int valorp3 = 0;
    static int valorp4 = 0;
    static int valorp5 = 0;
    private ValoresMetodologiaEstimacion vme = new ValoresMetodologiaEstimacion();
    // Fin valores de la metodología
/*listener para hacer y deshacer*/

    private void cargarListener() {

        jTextFieldDiasEmpresa.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldDiasEvaluador.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });


        jTextFieldNumeroModulosMedianos.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldNumeroModulosPequeños.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldUCE.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldUEX.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

        jTextFieldUNCE.getDocument().addUndoableEditListener(
                new UndoableEditListener() {

                    public void undoableEditHappened(UndoableEditEvent e) {
                        vista.getUndoManager().addEdit(e.getEdit());
                        vista.updateButtons();
                    }
                });

    }

    /** Creates new form PanelPaso1 */
    public PanelPaso1() {
        initComponents();
        this.cargarListener();
    }

    public JTextField getJTextFieldUCE() {
        return jTextFieldUCE;
    }

    public JTextField getJTextFieldUEX() {
        return jTextFieldUEX;
    }

    public JTextField getJTextFieldUNCE() {
        return jTextFieldUNCE;
    }

    public JRadioButton getJRadioButtonEmpresa() {
        return jRadioButtonEmpresa;
    }

    public JRadioButton getJRadioButtonEvaluador() {
        return jRadioButtonEvaluador;
    }

    public JRadioButton getJRadioButtonLugarArrendado() {
        return jRadioButtonLugarArrendado;
    }

    public JRadioButton getJRadioButtonLugarEmpresa() {
        return jRadioButtonLugarEmpresa;
    }

    public JRadioButton getJRadioButtonTamañoSoftwareGrande() {
        return jRadioButtonTamañoSoftwareGrande;
    }

    public JRadioButton getJRadioButtonTamañoSoftwareMedio() {
        return jRadioButtonTamañoSoftwareMedio;
    }

    public JRadioButton getJRadioButtonTamañoSoftwarePequeño() {
        return jRadioButtonTamañoSoftwarePequeño;
    }

    public JTextField getJTextFieldDiasEmpresa() {
        return jTextFieldDiasEmpresa;
    }

    public JTextField getJTextFieldDiasEvaluador() {
        return jTextFieldDiasEvaluador;
    }

    public JTextField getJTextFieldFactorTiempoEntrega() {
        return jTextFieldFactorTiempoEntrega;
    }

    public JTextField getJTextFieldHorasLugarEvaluacion() {
        return jTextFieldHorasLugarEvaluacion;
    }

    public JTextField getJTextFieldHorasTamañoSoftware() {
        return jTextFieldHorasTamañoSoftware;
    }

    public JTextField getJTextFieldHorasUsuariosEvaluadores() {
        return jTextFieldHorasUsuariosEvaluadores;
    }

    public JTextField getJTextFieldNumeroModulosMedianos() {
        return jTextFieldNumeroModulosMedianos;
    }

    public JTextField getJTextFieldNumeroModulosPequeños() {
        return jTextFieldNumeroModulosPequeños;
    }

    public JTextField getJTextFieldTotalUsuarios() {
        return jTextFieldTotalUsuarios;
    }

    public JRadioButton getjRadioButtonEmpresa() {
        return jRadioButtonEmpresa;
    }

    public JRadioButton getjRadioButtonLugarArrendado() {
        return jRadioButtonLugarArrendado;
    }

    public JRadioButton getjRadioButtonLugarEmpresa() {
        return jRadioButtonLugarEmpresa;
    }

    //Actualiza los valores del panel dado, suma o resta al valor del panel
    public static void actualizarpanel(int valor, int panel) {
        switch (panel) {
            case 1: {
                valorp1 += valor;
                break;
            }
            case 2: {
                valorp2 += valor;
                break;
            }
            case 3: {
                valorp3 += valor;
                break;
            }
            case 4: {
                valorp4 += valor;
                break;
            }
            case 5: {
                valorp5 += valor;
                break;
            }
            default: {
                break;
            }
        }

        actualizarbarra();

    }

    public void setBarraProgreso(JProgressBar barraProgreso) {
        this.barraProgreso = barraProgreso;
        /*Barra*/

        jTextFieldNumeroModulosPequeños.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldNumeroModulosPequeños,1,1));
        jTextFieldNumeroModulosMedianos.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldNumeroModulosMedianos,1,1));

        jTextFieldUCE.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldUCE,2,1));
        jTextFieldUNCE.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldUNCE,2,1));
        jTextFieldUEX.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldUEX,2,1));

        jTextFieldDiasEmpresa.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldDiasEmpresa,5,1));
        jTextFieldDiasEvaluador.getDocument().addDocumentListener(new ListenerTextBox(jTextFieldDiasEvaluador,5,1));


        jTextFieldNumeroModulosPequeños.addKeyListener(new ValidaBarras2(jTextFieldNumeroModulosPequeños, 1,1));
        jTextFieldNumeroModulosMedianos.addKeyListener(new ValidaBarras2(jTextFieldNumeroModulosMedianos, 1,1));

        jTextFieldUCE.addKeyListener(new ValidaBarras2(jTextFieldUCE, 2,1));
        jTextFieldUNCE.addKeyListener(new ValidaBarras2(jTextFieldUNCE, 2,1));
        jTextFieldUEX.addKeyListener(new ValidaBarras2(jTextFieldUEX, 2,1));

        jTextFieldDiasEmpresa.addKeyListener(new ValidaBarras2(jTextFieldDiasEmpresa, 5,1));
        jTextFieldDiasEvaluador.addKeyListener(new ValidaBarras2(jTextFieldDiasEvaluador, 5,1));
    }

    public void calculaHorasTamañoSoftware() {
        if (jRadioButtonTamañoSoftwarePequeño.isSelected()) {
            jTextFieldHorasTamañoSoftware.setText(String.valueOf(vme.getHorasPorSoftwarePequeño()));
        }
        if (jRadioButtonTamañoSoftwareMedio.isSelected()) {
            jTextFieldHorasTamañoSoftware.setText(String.valueOf(vme.getHorasPorSoftwareMediano()));
        }
        if (jRadioButtonTamañoSoftwareGrande.isSelected()) {
            int numeroModulosPequeños = 0;
            int numeroModulosMedianos = 0;
            if (!jTextFieldNumeroModulosPequeños.getText().equals("")) {
                numeroModulosPequeños = Integer.parseInt(jTextFieldNumeroModulosPequeños.getText());
            }
            if (!jTextFieldNumeroModulosMedianos.getText().equals("")) {
                numeroModulosMedianos = Integer.parseInt(jTextFieldNumeroModulosMedianos.getText());
            }

            jTextFieldHorasTamañoSoftware.setText(String.valueOf((numeroModulosPequeños * vme.getHorasPorSoftwarePequeño()) + (numeroModulosMedianos * vme.getHorasPorSoftwareMediano())));
        }
    }

    public void calculaHorasUsuariosEvaluadores() {
        if (!jTextFieldUNCE.getText().equals("")) {
            jTextFieldHorasUsuariosEvaluadores.setText(String.valueOf(vme.getAumentoHorasPorModalidadLugarEvaluacion()));
        } else {
            if (!jTextFieldUEX.getText().equals("")) {
                jTextFieldHorasUsuariosEvaluadores.setText("*8");
            } else {
                jTextFieldHorasUsuariosEvaluadores.setText("0");
            }
        }
    }

    public void calculaTotalUsuarios() {
        int contador = 0;

        if (!jTextFieldUCE.getText().equals("")) {
            contador += Integer.parseInt(jTextFieldUCE.getText());
        }
        if (!jTextFieldUNCE.getText().equals("")) {
            contador += Integer.parseInt(jTextFieldUNCE.getText());
        }
        if (!jTextFieldUEX.getText().equals("")) {
            contador += Integer.parseInt(jTextFieldUEX.getText());
        }
        jTextFieldTotalUsuarios.setText(String.valueOf(contador));
    }

    public void calculaHorasLugarEvaluacion() {
        if (jRadioButtonLugarArrendado.isSelected()) {
            jTextFieldHorasLugarEvaluacion.setText(String.valueOf(vme.getAumentoHorasPorModalidadLugarEvaluacion()));
        } else {
            jTextFieldHorasLugarEvaluacion.setText("0");
        }
    }

    public void calculaFactorTiempoEntrega() {
        if (jRadioButtonEvaluador.isSelected()) {
            jTextFieldFactorTiempoEntrega.setText(String.valueOf(1));
        } else {
            if (jTextFieldHorasTamañoSoftware.getText().equals("") || jTextFieldHorasTamañoSoftware.getText().equals("0")) {
                jTextFieldFactorTiempoEntrega.setText("1");
            } else {

                if ((Integer.parseInt(jTextFieldHorasTamañoSoftware.getText()) == 40) && jRadioButtonEmpresa.isSelected()) {
                    jTextFieldFactorTiempoEntrega.setText(String.valueOf(1 + vme.getPorcentajePorPeriodoEntregaVelozSoftwarePequeño()));
                }
                if ((Integer.parseInt(jTextFieldHorasTamañoSoftware.getText()) == 65) && jRadioButtonEmpresa.isSelected()) {
                    jTextFieldFactorTiempoEntrega.setText(String.valueOf(1 + vme.getPorcentajePorPeriodoEntregaVelozSoftwareGrande()));
                }
                if ((Integer.parseInt(jTextFieldHorasTamañoSoftware.getText()) > 65) && jRadioButtonEmpresa.isSelected()) {
                    jTextFieldFactorTiempoEntrega.setText(String.valueOf(1 + vme.getPorcentajePorPeriodoEntregaVelozSoftwareGrande()));
                }
            }
        }
    }

    public void setVista(VistaPrincipal vista) {
        this.vista = vista;
    }

    public void recalcular() {
        calculaHorasTamañoSoftware();
        calculaHorasUsuariosEvaluadores();
        calculaHorasLugarEvaluacion();
        calculaFactorTiempoEntrega();
    }

    public void cambioSeleccionTamañoSoftware(int radioButton) {
        switch (radioButton) {
            case 0: {
                jRadioButtonTamañoSoftwarePequeño.setSelected(true);
                break;
            }
            case 1: {
                jRadioButtonTamañoSoftwareMedio.setSelected(true);
                break;
            }
            case 2: {
                jRadioButtonTamañoSoftwareGrande.setSelected(true);
                break;
            }
            default: {
                break;
            }
        }
    }

//////////////Estas funciones son para guardar los datos en un archivo//////////
    public int retornarTamaño() {
        int tamaño = -1;
        if (jRadioButtonTamañoSoftwarePequeño.isSelected()) {
            tamaño = 1;
        }
        if (jRadioButtonTamañoSoftwareMedio.isSelected()) {
            tamaño = 2;
        }
        if (jRadioButtonTamañoSoftwareGrande.isSelected()) {
            tamaño = 3;
        }
        return tamaño;
    }

    public String retornarModulos() {
        String ModulosPequeños, ModulosMedianos, Modulos;
        ModulosPequeños = jTextFieldNumeroModulosPequeños.getText().toString();
        ModulosMedianos = jTextFieldNumeroModulosMedianos.getText().toString();
        if (ModulosPequeños.equals("")) {
            ModulosPequeños = "-1";
        }
        if (ModulosMedianos.equals("")) {
            ModulosMedianos = "-1";
        }
        Modulos = ModulosPequeños + "#" + ModulosMedianos;
        return Modulos;
    }

    public String retornarUsuarios() {
        String UCE, UNCE, UEX, SUMA, total;
        UCE = jTextFieldUCE.getText().toString();
        UNCE = jTextFieldUNCE.getText().toString();
        UEX = jTextFieldUEX.getText().toString();
        SUMA = jTextFieldTotalUsuarios.getText().toString();

        if (UCE.equals("")) {
            UCE = "-1";
        }
        if (UNCE.equals("")) {
            UNCE = "-1";
        }
        if (UEX.equals("")) {
            UEX = "-1";
        }
        // Grupo4: Error de programación, no se habia validado este campo
        if (SUMA.equals("")) {
            SUMA = "-1";
        }

        total = UCE + "#" + UNCE + "#" + UEX + "#" + SUMA;
        return total;
    }

    public int retornarLugar() {
        int lugar = -1;
        if (jRadioButtonLugarEmpresa.isSelected()) {
            lugar = 0;
        }
        if (jRadioButtonLugarArrendado.isSelected()) {
            lugar = 1;
        }
        return lugar;
    }

    public String retornarTiempos() {
        String tiempo, HorasTamaño, HorasUsuarios, HorasLugar;
        HorasTamaño = jTextFieldHorasTamañoSoftware.getText().toString();
        HorasUsuarios = jTextFieldHorasUsuariosEvaluadores.getText().toString();
        HorasLugar = jTextFieldHorasLugarEvaluacion.getText().toString();
        if (HorasTamaño.equals("")) {
            HorasTamaño = "-1";
        }
        if (HorasUsuarios.equals("")) {
            HorasUsuarios = "-1";
        }
        if (HorasLugar.equals("")) {
            HorasLugar = "-1";
        }
        tiempo = HorasTamaño + "#" + HorasUsuarios + "#" + HorasLugar;
        return tiempo;
    }

    public String retornarPeriodo() {
        String periodo, tipo = "-1", DiasEvaluador, DiasEmpresa, Factor;

        if (jRadioButtonEvaluador.isSelected()) {
            tipo = "0";
        }
        if (jRadioButtonEmpresa.isSelected()) {
            tipo = "1";
        }

        DiasEvaluador = jTextFieldDiasEvaluador.getText().toString();
        DiasEmpresa = jTextFieldDiasEmpresa.getText().toString();
        Factor = jTextFieldFactorTiempoEntrega.getText().toString();

        if (DiasEvaluador.equals("")) {
            DiasEvaluador = "-1";
        }
        if (DiasEmpresa.equals("")) {
            DiasEmpresa = "-1";
        }
        periodo = tipo + "#" + DiasEvaluador + "#" + DiasEmpresa + "#" + Factor;

        return periodo;
    }

    //Métodos para ABRIR y para LIMPIAR
    public void setTamañoSoftwarePequeño(boolean opcion) {
        this.jRadioButtonTamañoSoftwarePequeño.setSelected(opcion);
    }

    public void setTamañoSoftwareMedio(boolean opcion) {
        this.jRadioButtonTamañoSoftwareMedio.setSelected(opcion);
    }

    public void setTamañoSoftwareGrande(boolean opcion) {
        this.jRadioButtonTamañoSoftwareGrande.setSelected(opcion);
    }

    public void setLugarEmpresa(boolean opcion) {
        this.jRadioButtonLugarEmpresa.setSelected(opcion);
    }

    public void setLugarArrendado(boolean opcion) {
        this.jRadioButtonLugarArrendado.setSelected(opcion);
    }

    public void setNumeroModulosPequeños(String valor) {
        this.jTextFieldNumeroModulosPequeños.setText(valor);
    }

    public void setNumeroModulosMedianos(String valor) {
        this.jTextFieldNumeroModulosMedianos.setText(valor);
    }

    public void setHorasTamañoSoftware(String valor) {
        this.jTextFieldHorasTamañoSoftware.setText(valor);
    }

    public void setHorasUsuariosEvaluadores(String valor) {
        this.jTextFieldHorasUsuariosEvaluadores.setText(valor);
    }

    public void setHorasLugarEvaluacion(String valor) {
        this.jTextFieldHorasLugarEvaluacion.setText(valor);
    }

    public void setUCE(String valor) {
        this.jTextFieldUCE.setText(valor);
    }

    public void setUNCE(String valor) {
        this.jTextFieldUNCE.setText(valor);
    }

    public void setUEX(String valor) {
        this.jTextFieldUEX.setText(valor);
    }

    public void setTotalUsuarios(String valor) {
        this.jTextFieldTotalUsuarios.setText(valor);
    }

    public void setDiasEvaluador(String valor) {
        this.jTextFieldDiasEvaluador.setText(valor);
    }

    public void setDiasEmpresa(String valor) {
        this.jTextFieldDiasEmpresa.setText(valor);
    }

    public void setFactorTiempoEntrega(String valor) {
        this.jTextFieldFactorTiempoEntrega.setText(valor);
    }

    public void setEvaluador(boolean opcion) {
        this.jRadioButtonEvaluador.setSelected(opcion);
    }

    public void setEmpresa(boolean opcion) {
        this.jRadioButtonEmpresa.setSelected(opcion);
    }

    public JRadioButton getjRadioButtonEvaluador() {
        return jRadioButtonEvaluador;
    }

    public JRadioButton getjRadioButtonTamañoSoftwareGrande() {
        return jRadioButtonTamañoSoftwareGrande;
    }

    public JRadioButton getjRadioButtonTamañoSoftwareMedio() {
        return jRadioButtonTamañoSoftwareMedio;
    }

    public JRadioButton getjRadioButtonTamañoSoftwarePequeño() {
        return jRadioButtonTamañoSoftwarePequeño;
    }

    public JTextField getjTextFieldDiasEmpresa() {
        return jTextFieldDiasEmpresa;
    }

    public JTextField getjTextFieldDiasEvaluador() {
        return jTextFieldDiasEvaluador;
    }

    public JTextField getjTextFieldHorasLugarEvaluacion() {
        return jTextFieldHorasLugarEvaluacion;
    }

    public JTextField getjTextFieldNumeroModulosMedianos() {
        return jTextFieldNumeroModulosMedianos;
    }

    public JTextField getjTextFieldNumeroModulosPequeños() {
        return jTextFieldNumeroModulosPequeños;
    }

    public JTextField getjTextFieldUCE() {
        return jTextFieldUCE;
    }

    public JTextField getjTextFieldUEX() {
        return jTextFieldUEX;
    }

    public JTextField getjTextFieldUNCE() {
        return jTextFieldUNCE;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroupTamañoSoftware = new javax.swing.ButtonGroup();
        buttonGroupLugarEvaluacion = new javax.swing.ButtonGroup();
        buttonGroupModalidadPeriodoEntrega = new javax.swing.ButtonGroup();
        jPanelTamañoSoftware = new javax.swing.JPanel();
        jRadioButtonTamañoSoftwarePequeño = new javax.swing.JRadioButton();
        jRadioButtonTamañoSoftwareMedio = new javax.swing.JRadioButton();
        jRadioButtonTamañoSoftwareGrande = new javax.swing.JRadioButton();
        jLabelPrecisarNumeroModulos = new javax.swing.JLabel();
        jButtonDefinirTamañoSoftware = new javax.swing.JButton();
        jLabelNumeroModulosMedianos = new javax.swing.JLabel();
        jLabelNumeroModulosPequeños = new javax.swing.JLabel();
        jTextFieldNumeroModulosPequeños = new javax.swing.JTextField();
        jTextFieldNumeroModulosMedianos = new javax.swing.JTextField();
        jPanelModalidadUsuariosEvaluadores = new javax.swing.JPanel();
        jLabelTotalUsuarios = new javax.swing.JLabel();
        jLabelUEX = new javax.swing.JLabel();
        jLabelUNCE = new javax.swing.JLabel();
        jLabelUCE = new javax.swing.JLabel();
        jTextFieldUCE = new javax.swing.JTextField();
        jTextFieldUNCE = new javax.swing.JTextField();
        jTextFieldUEX = new javax.swing.JTextField();
        jTextFieldTotalUsuarios = new javax.swing.JTextField();
        jPanelLugarEvaluacion = new javax.swing.JPanel();
        jRadioButtonLugarEmpresa = new javax.swing.JRadioButton();
        jRadioButtonLugarArrendado = new javax.swing.JRadioButton();
        jPanelModalidadPeriodoEntrega = new javax.swing.JPanel();
        jRadioButtonEvaluador = new javax.swing.JRadioButton();
        jRadioButtonEmpresa = new javax.swing.JRadioButton();
        jLabelDiasEvaluador = new javax.swing.JLabel();
        jLabelDiasEmpresa = new javax.swing.JLabel();
        jTextFieldDiasEvaluador = new javax.swing.JTextField();
        jTextFieldDiasEmpresa = new javax.swing.JTextField();
        jLabelFactorTiempoEntrega = new javax.swing.JLabel();
        jTextFieldFactorTiempoEntrega = new javax.swing.JTextField();
        jPanelTiempoEmplear = new javax.swing.JPanel();
        jLabelHorasTamañoSoftware = new javax.swing.JLabel();
        jLabelHorasUsuariosEvaluadores = new javax.swing.JLabel();
        jLabelHorasLugarEvaluacion = new javax.swing.JLabel();
        jTextFieldHorasTamañoSoftware = new javax.swing.JTextField();
        jTextFieldHorasUsuariosEvaluadores = new javax.swing.JTextField();
        jTextFieldHorasLugarEvaluacion = new javax.swing.JTextField();

        setMaximumSize(new java.awt.Dimension(595, 540));
        setMinimumSize(new java.awt.Dimension(595, 540));
        setPreferredSize(new java.awt.Dimension(595, 540));

        jPanelTamañoSoftware.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Tamaño del software"));
        jPanelTamañoSoftware.setMaximumSize(new java.awt.Dimension(300, 230));
        jPanelTamañoSoftware.setMinimumSize(new java.awt.Dimension(298, 230));
        jPanelTamañoSoftware.setPreferredSize(new java.awt.Dimension(298, 234));

        buttonGroupTamañoSoftware.add(jRadioButtonTamañoSoftwarePequeño);
        jRadioButtonTamañoSoftwarePequeño.setText("Pequeño");
        jRadioButtonTamañoSoftwarePequeño.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cambioTamañoSoftware(evt);
            }
        });
        jRadioButtonTamañoSoftwarePequeño.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioButtonTamañoSoftwarePequeñoActionPerformed(evt);
            }
        });

        buttonGroupTamañoSoftware.add(jRadioButtonTamañoSoftwareMedio);
        jRadioButtonTamañoSoftwareMedio.setText("Medio");
        jRadioButtonTamañoSoftwareMedio.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cambioTamañoSoftware(evt);
            }
        });

        buttonGroupTamañoSoftware.add(jRadioButtonTamañoSoftwareGrande);
        jRadioButtonTamañoSoftwareGrande.setText("Grande");
        jRadioButtonTamañoSoftwareGrande.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cambioTamañoSoftware(evt);
            }
        });

        jLabelPrecisarNumeroModulos.setText("Software Grande debe precisar el número de módulos:");

        jButtonDefinirTamañoSoftware.setText("Ayúdame a definir el tamaño");
        jButtonDefinirTamañoSoftware.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonDefinirTamañoSoftwareActionPerformed(evt);
            }
        });

        jLabelNumeroModulosMedianos.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabelNumeroModulosMedianos.setText("Número de módulos medianos:");

        jLabelNumeroModulosPequeños.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabelNumeroModulosPequeños.setText("Número de módulos pequeños:");

        jTextFieldNumeroModulosPequeños.setToolTipText("Ingrese un número entero positivo");
        jTextFieldNumeroModulosPequeños.setEnabled(false);
        jTextFieldNumeroModulosPequeños.setPreferredSize(new java.awt.Dimension(100, 20));
        jTextFieldNumeroModulosPequeños.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldNumeroModulosPequeñosKeyReleased(evt);
            }
        });

        jTextFieldNumeroModulosMedianos.setToolTipText("Ingrese un número entero positivo");
        jTextFieldNumeroModulosMedianos.setEnabled(false);
        jTextFieldNumeroModulosMedianos.setPreferredSize(new java.awt.Dimension(100, 20));
        jTextFieldNumeroModulosMedianos.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldNumeroModulosMedianosKeyReleased(evt);
            }
        });

        javax.swing.GroupLayout jPanelTamañoSoftwareLayout = new javax.swing.GroupLayout(jPanelTamañoSoftware);
        jPanelTamañoSoftware.setLayout(jPanelTamañoSoftwareLayout);
        jPanelTamañoSoftwareLayout.setHorizontalGroup(
            jPanelTamañoSoftwareLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTamañoSoftwareLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelTamañoSoftwareLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelTamañoSoftwareLayout.createSequentialGroup()
                        .addGroup(jPanelTamañoSoftwareLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jRadioButtonTamañoSoftwareGrande, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jRadioButtonTamañoSoftwareMedio, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jRadioButtonTamañoSoftwarePequeño, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(24, 24, 24)
                        .addComponent(jButtonDefinirTamañoSoftware))
                    .addGroup(jPanelTamañoSoftwareLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addComponent(jLabelPrecisarNumeroModulos)
                        .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanelTamañoSoftwareLayout.createSequentialGroup()
                            .addGroup(jPanelTamañoSoftwareLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(jLabelNumeroModulosMedianos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabelNumeroModulosPequeños))
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addGroup(jPanelTamañoSoftwareLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jTextFieldNumeroModulosMedianos, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jTextFieldNumeroModulosPequeños, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(29, Short.MAX_VALUE))
        );
        jPanelTamañoSoftwareLayout.setVerticalGroup(
            jPanelTamañoSoftwareLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTamañoSoftwareLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jRadioButtonTamañoSoftwarePequeño)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelTamañoSoftwareLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButtonTamañoSoftwareMedio)
                    .addComponent(jButtonDefinirTamañoSoftware))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButtonTamañoSoftwareGrande)
                .addGap(18, 18, 18)
                .addComponent(jLabelPrecisarNumeroModulos)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelTamañoSoftwareLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelNumeroModulosPequeños)
                    .addComponent(jTextFieldNumeroModulosPequeños, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelTamañoSoftwareLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelNumeroModulosMedianos, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextFieldNumeroModulosMedianos, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(36, 36, 36))
        );

        jPanelModalidadUsuariosEvaluadores.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Modalidad de Usuarios Evaluadores"));
        jPanelModalidadUsuariosEvaluadores.setMaximumSize(new java.awt.Dimension(292, 169));
        jPanelModalidadUsuariosEvaluadores.setMinimumSize(new java.awt.Dimension(292, 169));

        jLabelTotalUsuarios.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabelTotalUsuarios.setText("Total de Usuarios:");

        jLabelUEX.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabelUEX.setText("UEX:");
        jLabelUEX.setToolTipText("Usuarios Externos");

        jLabelUNCE.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabelUNCE.setText("UNCE:");
        jLabelUNCE.setToolTipText("Usuarios No Comprometidos por la Empresa");

        jLabelUCE.setHorizontalAlignment(javax.swing.SwingConstants.RIGHT);
        jLabelUCE.setText("UCE:");
        jLabelUCE.setToolTipText("Usuarios Comprometidos por la Empresa");

        jTextFieldUCE.setToolTipText("Ingrese un número entero positivo");
        jTextFieldUCE.setPreferredSize(new java.awt.Dimension(100, 20));
        jTextFieldUCE.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldUCEKeyReleased(evt);
            }
        });

        jTextFieldUNCE.setToolTipText("Ingrese un número entero positivo");
        jTextFieldUNCE.setPreferredSize(new java.awt.Dimension(100, 20));
        jTextFieldUNCE.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldUNCEKeyReleased(evt);
            }
        });

        jTextFieldUEX.setToolTipText("Ingrese un número entero positivo");
        jTextFieldUEX.setPreferredSize(new java.awt.Dimension(100, 20));
        jTextFieldUEX.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextFieldUEXKeyReleased(evt);
            }
        });

        jTextFieldTotalUsuarios.setEnabled(false);
        jTextFieldTotalUsuarios.setPreferredSize(new java.awt.Dimension(100, 20));

        javax.swing.GroupLayout jPanelModalidadUsuariosEvaluadoresLayout = new javax.swing.GroupLayout(jPanelModalidadUsuariosEvaluadores);
        jPanelModalidadUsuariosEvaluadores.setLayout(jPanelModalidadUsuariosEvaluadoresLayout);
        jPanelModalidadUsuariosEvaluadoresLayout.setHorizontalGroup(
            jPanelModalidadUsuariosEvaluadoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createSequentialGroup()
                        .addComponent(jLabelUCE, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jTextFieldUCE, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createSequentialGroup()
                        .addComponent(jLabelUNCE, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jTextFieldUNCE, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createSequentialGroup()
                        .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jLabelTotalUsuarios, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jLabelUEX, javax.swing.GroupLayout.DEFAULT_SIZE, 107, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jTextFieldTotalUsuarios, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldUEX, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap(65, Short.MAX_VALUE))
        );
        jPanelModalidadUsuariosEvaluadoresLayout.setVerticalGroup(
            jPanelModalidadUsuariosEvaluadoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelUCE)
                    .addComponent(jTextFieldUCE, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelUNCE)
                    .addComponent(jTextFieldUNCE, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelUEX)
                    .addComponent(jTextFieldUEX, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelModalidadUsuariosEvaluadoresLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelTotalUsuarios)
                    .addComponent(jTextFieldTotalUsuarios, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(19, Short.MAX_VALUE))
        );

        jPanelLugarEvaluacion.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Lugar de Evaluación"));
        jPanelLugarEvaluacion.setMaximumSize(new java.awt.Dimension(279, 89));
        jPanelLugarEvaluacion.setMinimumSize(new java.awt.Dimension(279, 89));
        jPanelLugarEvaluacion.setPreferredSize(new java.awt.Dimension(279, 100));

        buttonGroupLugarEvaluacion.add(jRadioButtonLugarEmpresa);
        jRadioButtonLugarEmpresa.setText("Lugar Empresa");
        jRadioButtonLugarEmpresa.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cambioLugarEvaluacion(evt);
            }
        });

        buttonGroupLugarEvaluacion.add(jRadioButtonLugarArrendado);
        jRadioButtonLugarArrendado.setText("Lugar Arrendado");
        jRadioButtonLugarArrendado.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                cambioLugarEvaluacion(evt);
            }
        });

        javax.swing.GroupLayout jPanelLugarEvaluacionLayout = new javax.swing.GroupLayout(jPanelLugarEvaluacion);
        jPanelLugarEvaluacion.setLayout(jPanelLugarEvaluacionLayout);
        jPanelLugarEvaluacionLayout.setHorizontalGroup(
            jPanelLugarEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelLugarEvaluacionLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelLugarEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jRadioButtonLugarEmpresa, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jRadioButtonLugarArrendado, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(170, Short.MAX_VALUE))
        );
        jPanelLugarEvaluacionLayout.setVerticalGroup(
            jPanelLugarEvaluacionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelLugarEvaluacionLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jRadioButtonLugarEmpresa)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jRadioButtonLugarArrendado)
                .addContainerGap(18, Short.MAX_VALUE))
        );

        jPanelModalidadPeriodoEntrega.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Modalidad Período de Entrega"));
        jPanelModalidadPeriodoEntrega.setMaximumSize(new java.awt.Dimension(279, 94));
        jPanelModalidadPeriodoEntrega.setMinimumSize(new java.awt.Dimension(279, 94));
        jPanelModalidadPeriodoEntrega.setPreferredSize(new java.awt.Dimension(279, 154));

        buttonGroupModalidadPeriodoEntrega.add(jRadioButtonEvaluador);
        jRadioButtonEvaluador.setText("Evaluador");
        jRadioButtonEvaluador.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                CambioPeriodoEntrega(evt);
            }
        });

        buttonGroupModalidadPeriodoEntrega.add(jRadioButtonEmpresa);
        jRadioButtonEmpresa.setText("Empresa");
        jRadioButtonEmpresa.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                CambioPeriodoEntrega(evt);
            }
        });

        jLabelDiasEvaluador.setText("Días");

        jLabelDiasEmpresa.setText("Días");

        jTextFieldDiasEvaluador.setToolTipText("Ingrese un número entero positivo");
        jTextFieldDiasEvaluador.setEnabled(false);
        jTextFieldDiasEvaluador.setPreferredSize(new java.awt.Dimension(100, 20));

        jTextFieldDiasEmpresa.setToolTipText("Ingrese un número entero positivo");
        jTextFieldDiasEmpresa.setEnabled(false);
        jTextFieldDiasEmpresa.setPreferredSize(new java.awt.Dimension(100, 20));

        jLabelFactorTiempoEntrega.setText("Factor tiempo de entrega:");

        jTextFieldFactorTiempoEntrega.setText("1");
        jTextFieldFactorTiempoEntrega.setEnabled(false);

        javax.swing.GroupLayout jPanelModalidadPeriodoEntregaLayout = new javax.swing.GroupLayout(jPanelModalidadPeriodoEntrega);
        jPanelModalidadPeriodoEntrega.setLayout(jPanelModalidadPeriodoEntregaLayout);
        jPanelModalidadPeriodoEntregaLayout.setHorizontalGroup(
            jPanelModalidadPeriodoEntregaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelModalidadPeriodoEntregaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelModalidadPeriodoEntregaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanelModalidadPeriodoEntregaLayout.createSequentialGroup()
                        .addGroup(jPanelModalidadPeriodoEntregaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jRadioButtonEmpresa, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jRadioButtonEvaluador, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(26, 26, 26)
                        .addGroup(jPanelModalidadPeriodoEntregaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                            .addComponent(jTextFieldDiasEvaluador, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jTextFieldDiasEmpresa, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanelModalidadPeriodoEntregaLayout.createSequentialGroup()
                        .addComponent(jLabelFactorTiempoEntrega, javax.swing.GroupLayout.PREFERRED_SIZE, 142, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jTextFieldFactorTiempoEntrega)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelModalidadPeriodoEntregaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabelDiasEmpresa)
                    .addComponent(jLabelDiasEvaluador))
                .addContainerGap(44, Short.MAX_VALUE))
        );
        jPanelModalidadPeriodoEntregaLayout.setVerticalGroup(
            jPanelModalidadPeriodoEntregaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelModalidadPeriodoEntregaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelModalidadPeriodoEntregaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButtonEvaluador)
                    .addComponent(jLabelDiasEvaluador)
                    .addComponent(jTextFieldDiasEvaluador, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanelModalidadPeriodoEntregaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jRadioButtonEmpresa)
                    .addComponent(jLabelDiasEmpresa)
                    .addComponent(jTextFieldDiasEmpresa, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelModalidadPeriodoEntregaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextFieldFactorTiempoEntrega, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabelFactorTiempoEntrega))
                .addContainerGap(40, Short.MAX_VALUE))
        );

        jPanelTiempoEmplear.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createEtchedBorder(), "Tiempo a Emplear"));
        jPanelTiempoEmplear.setMaximumSize(new java.awt.Dimension(279, 131));
        jPanelTiempoEmplear.setMinimumSize(new java.awt.Dimension(279, 131));
        jPanelTiempoEmplear.setPreferredSize(new java.awt.Dimension(279, 131));

        jLabelHorasTamañoSoftware.setText("Horas por Tamaño Software:");

        jLabelHorasUsuariosEvaluadores.setText("Horas por Usuarios Evaluadores:");

        jLabelHorasLugarEvaluacion.setText("Horas por Lugar de Evaluación:");

        jTextFieldHorasTamañoSoftware.setToolTipText("Ingrese un número entero positivo");
        jTextFieldHorasTamañoSoftware.setEnabled(false);
        jTextFieldHorasTamañoSoftware.setPreferredSize(new java.awt.Dimension(80, 20));

        jTextFieldHorasUsuariosEvaluadores.setToolTipText("Ingrese un número entero positivo");
        jTextFieldHorasUsuariosEvaluadores.setEnabled(false);
        jTextFieldHorasUsuariosEvaluadores.setPreferredSize(new java.awt.Dimension(80, 20));

        jTextFieldHorasLugarEvaluacion.setToolTipText("Ingrese un número entero positivo");
        jTextFieldHorasLugarEvaluacion.setEnabled(false);
        jTextFieldHorasLugarEvaluacion.setPreferredSize(new java.awt.Dimension(80, 20));

        javax.swing.GroupLayout jPanelTiempoEmplearLayout = new javax.swing.GroupLayout(jPanelTiempoEmplear);
        jPanelTiempoEmplear.setLayout(jPanelTiempoEmplearLayout);
        jPanelTiempoEmplearLayout.setHorizontalGroup(
            jPanelTiempoEmplearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTiempoEmplearLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelTiempoEmplearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabelHorasLugarEvaluacion, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabelHorasTamañoSoftware, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabelHorasUsuariosEvaluadores, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelTiempoEmplearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextFieldHorasUsuariosEvaluadores, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldHorasTamañoSoftware, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jTextFieldHorasLugarEvaluacion, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(26, Short.MAX_VALUE))
        );
        jPanelTiempoEmplearLayout.setVerticalGroup(
            jPanelTiempoEmplearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanelTiempoEmplearLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanelTiempoEmplearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelHorasTamañoSoftware)
                    .addComponent(jTextFieldHorasTamañoSoftware, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelTiempoEmplearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelHorasUsuariosEvaluadores)
                    .addComponent(jTextFieldHorasUsuariosEvaluadores, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanelTiempoEmplearLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabelHorasLugarEvaluacion)
                    .addComponent(jTextFieldHorasLugarEvaluacion, javax.swing.GroupLayout.PREFERRED_SIZE, 20, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelModalidadUsuariosEvaluadores, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelTamañoSoftware, javax.swing.GroupLayout.PREFERRED_SIZE, 312, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelModalidadPeriodoEntrega, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
                    .addComponent(jPanelLugarEvaluacion, javax.swing.GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
                    .addComponent(jPanelTiempoEmplear, javax.swing.GroupLayout.PREFERRED_SIZE, 295, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jPanelLugarEvaluacion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jPanelTiempoEmplear, javax.swing.GroupLayout.PREFERRED_SIZE, 130, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jPanelTamañoSoftware, javax.swing.GroupLayout.DEFAULT_SIZE, 236, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanelModalidadPeriodoEntrega, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanelModalidadUsuariosEvaluadores, 0, 154, Short.MAX_VALUE))
                .addContainerGap(133, Short.MAX_VALUE))
        );
    }// </editor-fold>//GEN-END:initComponents

	private void jButtonDefinirTamañoSoftwareActionPerformed (java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDefinirTamañoSoftwareActionPerformed
            DialogoMetodoMPF dialogoTamañoSoftware = new DialogoMetodoMPF(vista, true);
            dialogoTamañoSoftware.setVisible(true);
	}//GEN-LAST:event_jButtonDefinirTamañoSoftwareActionPerformed

        private void cambioTamañoSoftware(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cambioTamañoSoftware
            if (evt.getStateChange() == ItemEvent.SELECTED) {
                if (jRadioButtonTamañoSoftwareGrande.isSelected()) {
                    jTextFieldNumeroModulosPequeños.setEnabled(true);
                    jTextFieldNumeroModulosMedianos.setEnabled(true);
                    valorp1 = 1;
                    if (!jTextFieldNumeroModulosPequeños.getText().equals("") && jTextFieldNumeroModulosMedianos.getText().equals("")) {
                        valorp1 = 2;
                    }

                    if (jTextFieldNumeroModulosPequeños.getText().equals("") && !jTextFieldNumeroModulosMedianos.getText().equals("")) {
                        valorp1 = 2;
                    }

                    if (!jTextFieldNumeroModulosPequeños.getText().equals("") && !jTextFieldNumeroModulosMedianos.getText().equals("")) {
                        valorp1 = 3;
                    }
                    TimingUtils.showTimedBalloon(new BalloonTip(jTextFieldNumeroModulosPequeños, "Recuerde ingresar estos valores",
                            new MinimalBalloonStyle(new Color(231, 225, 165), 2), BalloonTip.Orientation.LEFT_ABOVE,
                            BalloonTip.AttachLocation.SOUTHEAST, 20, 10, false), 3000);
                } else {
                    valorp1 = 3;

                    jTextFieldNumeroModulosPequeños.setEnabled(false);
                    jTextFieldNumeroModulosMedianos.setEnabled(false);
                }

                actualizarbarra();
                calculaHorasTamañoSoftware();
                calculaFactorTiempoEntrega();

            }
        }//GEN-LAST:event_cambioTamañoSoftware

    //Cada panel de la pestaña 1 esta dividivo y se le asigna un valor, esta funcion actualiza la barra en funcion del valor
    public static void actualizarbarra() {
        int total = valorp1 + valorp2 + valorp3 + valorp4 + valorp5;
        barraProgreso.setValue(total);
    }

    //Deja los valores por defecto
    public static void limpiarbarra(){
        valorp1 = 0;
        valorp2 = 0;
        valorp3 = 0;
        valorp4 = 0;
        valorp5 = 0;
        actualizarbarra();
    }

        private void cambioLugarEvaluacion(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_cambioLugarEvaluacion
            valorp3 = 1;
            actualizarbarra();
            calculaHorasLugarEvaluacion();
        }//GEN-LAST:event_cambioLugarEvaluacion

        private void CambioPeriodoEntrega(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_CambioPeriodoEntrega
            if (evt.getStateChange() == ItemEvent.SELECTED) {

                if (jRadioButtonEmpresa.isSelected()) {
                    valorp5 = 1;
                    jTextFieldDiasEmpresa.setEnabled(true);
                    jTextFieldDiasEvaluador.setEnabled(false);

                    if (!jTextFieldDiasEmpresa.getText().equals("")) {
                        valorp5 = 2;
                    } else {
                        valorp5 = 1;
                    }

                } else {
                    jTextFieldDiasEmpresa.setEnabled(false);
                    jTextFieldDiasEvaluador.setEnabled(true);
                    if (!jTextFieldDiasEvaluador.getText().equals("")) {
                        valorp5 = 2;
                    } else {
                        valorp5 = 1;
                    }

                }
                actualizarbarra();
                calculaFactorTiempoEntrega();
            }
        }//GEN-LAST:event_CambioPeriodoEntrega

		private void jTextFieldUCEKeyReleased (java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldUCEKeyReleased
                    calculaTotalUsuarios();
		}//GEN-LAST:event_jTextFieldUCEKeyReleased

		private void jTextFieldUNCEKeyReleased (java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldUNCEKeyReleased
                    calculaTotalUsuarios();
                    calculaHorasUsuariosEvaluadores();
		}//GEN-LAST:event_jTextFieldUNCEKeyReleased

		private void jTextFieldUEXKeyReleased (java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldUEXKeyReleased
                    calculaTotalUsuarios();
                    calculaHorasUsuariosEvaluadores();
		}//GEN-LAST:event_jTextFieldUEXKeyReleased

		private void jTextFieldNumeroModulosPequeñosKeyReleased (java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldNumeroModulosPequeñosKeyReleased
                    calculaHorasTamañoSoftware();
                    calculaFactorTiempoEntrega();
		}//GEN-LAST:event_jTextFieldNumeroModulosPequeñosKeyReleased

		private void jTextFieldNumeroModulosMedianosKeyReleased (java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextFieldNumeroModulosMedianosKeyReleased
                    calculaHorasTamañoSoftware();
                    calculaFactorTiempoEntrega();
		}//GEN-LAST:event_jTextFieldNumeroModulosMedianosKeyReleased

                private void jRadioButtonTamañoSoftwarePequeñoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioButtonTamañoSoftwarePequeñoActionPerformed
                    // TODO add your handling code here:
                }//GEN-LAST:event_jRadioButtonTamañoSoftwarePequeñoActionPerformed
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public javax.swing.ButtonGroup buttonGroupLugarEvaluacion;
    public javax.swing.ButtonGroup buttonGroupModalidadPeriodoEntrega;
    public javax.swing.ButtonGroup buttonGroupTamañoSoftware;
    private javax.swing.JButton jButtonDefinirTamañoSoftware;
    private javax.swing.JLabel jLabelDiasEmpresa;
    private javax.swing.JLabel jLabelDiasEvaluador;
    private javax.swing.JLabel jLabelFactorTiempoEntrega;
    private javax.swing.JLabel jLabelHorasLugarEvaluacion;
    private javax.swing.JLabel jLabelHorasTamañoSoftware;
    private javax.swing.JLabel jLabelHorasUsuariosEvaluadores;
    private javax.swing.JLabel jLabelNumeroModulosMedianos;
    private javax.swing.JLabel jLabelNumeroModulosPequeños;
    private javax.swing.JLabel jLabelPrecisarNumeroModulos;
    private javax.swing.JLabel jLabelTotalUsuarios;
    private javax.swing.JLabel jLabelUCE;
    private javax.swing.JLabel jLabelUEX;
    private javax.swing.JLabel jLabelUNCE;
    private javax.swing.JPanel jPanelLugarEvaluacion;
    private javax.swing.JPanel jPanelModalidadPeriodoEntrega;
    private javax.swing.JPanel jPanelModalidadUsuariosEvaluadores;
    private javax.swing.JPanel jPanelTamañoSoftware;
    private javax.swing.JPanel jPanelTiempoEmplear;
    private javax.swing.JRadioButton jRadioButtonEmpresa;
    private javax.swing.JRadioButton jRadioButtonEvaluador;
    private javax.swing.JRadioButton jRadioButtonLugarArrendado;
    private javax.swing.JRadioButton jRadioButtonLugarEmpresa;
    private javax.swing.JRadioButton jRadioButtonTamañoSoftwareGrande;
    private javax.swing.JRadioButton jRadioButtonTamañoSoftwareMedio;
    public javax.swing.JRadioButton jRadioButtonTamañoSoftwarePequeño;
    private javax.swing.JTextField jTextFieldDiasEmpresa;
    private javax.swing.JTextField jTextFieldDiasEvaluador;
    private javax.swing.JTextField jTextFieldFactorTiempoEntrega;
    private javax.swing.JTextField jTextFieldHorasLugarEvaluacion;
    private javax.swing.JTextField jTextFieldHorasTamañoSoftware;
    private javax.swing.JTextField jTextFieldHorasUsuariosEvaluadores;
    private javax.swing.JTextField jTextFieldNumeroModulosMedianos;
    private javax.swing.JTextField jTextFieldNumeroModulosPequeños;
    private javax.swing.JTextField jTextFieldTotalUsuarios;
    private javax.swing.JTextField jTextFieldUCE;
    private javax.swing.JTextField jTextFieldUEX;
    private javax.swing.JTextField jTextFieldUNCE;
    // End of variables declaration//GEN-END:variables
}
